<?php include view_path().'header_total.php'; ?>
<?php $CI =& get_instance(); 

?>
<link rel='stylesheet' href='<?php echo css_url() . '960grid/960.css' ?>' />
<link rel='stylesheet' href='<?php echo css_url() . '960grid/960_table.css' ?>' />
<link rel="stylesheet" type="text/css" href="<?php echo css_url() . 'display_style.css' ?>">

<section id="body">
    <div class="body-container">
        <div class="panel-holder">
            <?php //var_dump($DesInfo); ?>
            <div class="heading">User Information</div>

            <!-- Address Field -->
            <div class="container_12 margin-bottom">
                <div class="grid_3 text">
                    <image src="<?php echo $DesInfo['AvatarLink'] ?>" style="width:100%"/> 
                </div>
                <div class="grid_2 text-head">Email: <br><br> 
                    Full Name: <br><br> 
                    Age: <br><br> 
                    Sex:<br><br> 
                    Married Status:<br><br> 
                </div>
                <div class="grid_2 text"><?php echo $DesInfo['RelUserEmail']; ?><br><br> 
                    <?php echo $DesInfo['UserFullname']; ?><br><br>  
                    <?php echo $DesInfo['Age']; ?><br><br> 
                    <?php echo $DesInfo['Sex']; ?><br><br>
                    <?php echo $DesInfo['MarriedStatus']; ?><br><br>  
                </div>
            </div>

            <!-- Phone Fields -->
            <div class="container_12 margin-bottom">
                <div class="grid_1 text-head">
                    Phone:
                </div>

                <div class="grid_10 text">
                    <?php
                        $AddrPhones = explode('#',$DesInfo['Phone']);
                        $Temp = implode(' - ', $AddrPhones);
                        echo $Temp;
                    ?>
                </div>
            </div>        
            
            <!-- Address Field -->
            <div class="container_12 margin-bottom">
                <?php
                    $AddrArray = explode('#', $DesInfo['Address']);
                ?>
                <div class="grid_1 text-head">Address:</div>
                <div class="grid_2 text" style="font-weight: 600; text-align: right;">
                    Province:<br><br>
                    District:
                </div>
                <div class="grid_2 text">
                    <?php 
                        if(!empty($AddrArray[0]))
                            echo $AddrArray[0].'<br><br>';
                        else
                            echo 'None'.'<br><br>';
                        ?>
                    <?php echo $AddrArray[2];?>
                </div>
                <div class="grid_1 text" style="font-weight: 600; text-align: right;">
                    City:<br><br>
                    Street:
                </div>
                <div class="grid_3 text">
                    <?php 
                        if(!empty($AddrArray[1]))
                            echo $AddrArray[1].'<br><br>';
                        else
                            echo 'None'.'<br><br>';
                        ?>
                    <?php echo $AddrArray[3];?>
                </div>
            </div>        
            
            <!-- Qualification Field -->
            <div id="qualification-section">
            <div class="container_12 margin-bottom" >
                <div class="grid_2 text-head">
                    Education Level:
                </div>
                
                <div class="grid_3 text">
                    <?php echo QualificationRecognize($DesInfo['Qualification']);?>
                </div>
            </div>
            
            <div class="container_12 margin-bottom" >
                <div class="grid_3 text-head">
                    Additional Qualification:
                </div>
            </div>          
            <?php foreach($DesInfo['Qualifications'] as $Qualification):?>
                <div class="container_12 margin-bottom" >
                    <div class="grid_1"> &nbsp;</div>
                    <div class="grid_2 text-head">
                        <?php 
                            $temp = explode('#',$Qualification['QualificationName']);
                            echo implode(' - ', $temp);
                        ?>
                    </div>
                    
                    <?php if(!empty($Qualification['QualificationLevel'])):?>
                    <div class="grid_1 text">
                        <?php echo ''.$Qualification['QualificationLevel']?>
                    </div>
                    <?php endif;?>
                    
                    <?php if(!empty($Qualification['Year'])):?>
                    <div class="grid_2 text">
                        <?php echo 'Year: '.$Qualification['Year']?>
                    </div>
                    <?php endif;?>
                    
                    <?php if(!empty($Qualification['ConfirmLink'])):?>
                    <div class="grid_2 text">
                        <a href="<?php echo $Qualification['ConfirmLink']?>">Confirm Link</a>
                    </div>
                    <?php endif;?>
                    
                </div>
            <?php endforeach;?>
            </div>
            <!-- Experience Field -->
            <div id="experience-section">
                <div class="container_12 margin-bottom">
                    <div class="grid_3 text-head">
                        Experience:
                    </div>
                </div>

                <!--- Working At -->
                <?php if(!empty($DesInfo['WorkingPlace'])):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_1 text-head">&nbsp;</div>
                    <div class="grid_2 text-head">
                        Working At:   
                    </div>

                    <div class="grid_3 text">
                        <?php echo $DesInfo['WorkingPlace'];?>
                    </div>
                </div>
                <?php endif;?>
            </div>
                <!-- Experience -->
                <?php if(!empty($DesInfo['WorkedPlaces'])):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_1 text-head">&nbsp;</div>
                    <div class="grid_2 text-head">
                        Worked At:   
                    </div>
                </div>
                
                    <?php foreach($DesInfo['WorkedPlaces'] as $WorkedPlace):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">&nbsp;</div>
                    <!-- Year -->
                    <div class="grid_2 text-head">
                        <?php echo $WorkedPlace['Year'];?> 
                    </div>
                    <!-- Company Name-->
                    <div class="grid_4 text">
                        Worked At: <span class="text-head"><?php echo $WorkedPlace['CompanyName'];?> </span>
                    </div>                            
                </div>
                <!-- Describtion -->
                    <?php if(!empty($WorkedPlace['Describtion'])):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">&nbsp;</div>
                    <div class="grid_10 text">
                        <?php echo $WorkedPlace['Describtion'];?>
                    </div>
                </div>
                    <?php endif;?>  
                    <?php endforeach;?>
                <?php endif;?>
            <!-- Hoobies Field -->
            <div>
            <?php 
                if(!empty($DesInfo['Hobbies'])){
                    $Hobbies = $DesInfo['Hobbies'];
                    $Hobbies = explode("##", $Hobbies);
                    $Hobbies = implode("<br>", $Hobbies);
                    ?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">Hobbies;</div>
                    <div class="grid_10 text">
                        <?php echo $Hobbies;?>
                    </div>
                </div>
            <?php } ?>
            </div>
            <!-- Activities Field -->
            <div>
                <?php if(count($DesInfo['Activities'])):?>
                <div class="container_12 margin-bottom">
                    <div class="grid_2 text-head">Activities:</div>
                </div>

                <?php foreach($DesInfo['Activities'] as $Activity):?>
                    <div class="container_12 margin-bottom">
                        <div class="grid_1">&nbsp;</div>            
                        <div class="grid_2 text-head"><?php echo $Activity['ActYear']?></div>
                        <div class="grid_3 text"><?php echo $Activity['ActTitle']?></div>
                    </div>
                
                    <div class="container_12 margin-bottom">     
                        <div class="grid_1">&nbsp;</div>    
                        <div class="grid_6 text"><?php echo $Activity['ActDescribtion']?></div>
                    </div>
                <?php endforeach; ?>
                <?php endif; ?>
            </div>
            <!-- Describtion Field -->
            <div class="container_12 margin-bottom">
                <div class="grid_2 text-head">Introduction:</div>
                <div class="grid_10 text"><?php echo $DesInfo['Describtion']; ?></div>
            </div>
        </div>
        
        <!-- Compare Requirement Table -->
        <div id="Comare-table-area" class="panel-holder">
            
            <!-- Header Table -->
            <div class="container_12 header margin-bottom">
                <div class="grid_1"> &nbsp;</div>
                <div class="grid_3">Requirement</div>
                <div class="grid_3">Level</div>
                <div class="grid_2">Pass</div>
            </div>
            <?php foreach($PAReqs as $Req):?>
            <div class="container_12 row margin-bottom border-bottom">
                <div class="grid_1"> &nbsp;</div>
                <div class="grid_3"><?php echo $Req['ReqName'];?></div>
                <div class="grid_3" style='text-align: center;'>
                    <?php 
                    if(!empty($Req['ReqLevel']))
                        echo $Req['ReqLevel'];
                    else
                        echo "&nbsp;";
                    ?>
                </div>
                <div class="grid_2" style='text-align: center;'>
                    <?php 
                    switch($Req['ReqPass']){
                        case 0;
                            echo '<image src="'.image_url().'icon/fail_icon.png'.'" style="width:20px" />';
                            break;
                        case 1:
                            echo '<image src="'.image_url().'icon/warning_icon.png'.'" style="width:20px" />';
                            break;
                        case 2:
                            echo '<image src="'.image_url().'icon/pass_icon.png'.'" style="width:20px" />';
                            break;
                    }
                    ?>
                </div>
            </div>
            <?php endforeach; ?>
    </div>
</section>

<?php include view_path().'footer.php'; ?>
